from rest_framework.serializers import ModelSerializer
from .models import Banner, Nav

# 轮播图序列化器
class BannerSerializer(ModelSerializer):
    class Meta:
        model = Banner
        fields = ['image_url', 'link']


# 导航栏的序列化器
class NavSerializer(ModelSerializer):
    class Meta:
        model = Nav
        fields=  ['title', 'link', 'is_site']